<?php

require_once 'base/base_categories.class.php';
require_once 'UserServiceCategory.php';

/**
 *  zend db table
 */
class Application_Model_DbTable_UserServiceCategories extends Zend_Db_Table_Abstract
{
    protected $_name = 'ap_user_service_category';
}


/**
 *  
 */
class UserServiceCategories extends BaseCategories
{
    protected $_modelName   = 'UserServiceCategory';
    protected $_dbTableName = 'Application_Model_DbTable_UserServiceCategories';

    /* ================================================================================
        access database
    ================================================================================ */

    /**
     *  add UserServiceCategory
     */
    public function addUserServiceCategory( $model )
    {
        return $this->addCategory( $model );
    }

    /**
     *  update UserServiceCategory
     */
    public function updateUserServiceCategory( $model )
    {
        return $this->updateCategory( $model );
    }

    /**
     *  get UserServiceCategory
     */
    public function getUserServiceCategory( $id, $userId=null, $status=UserServiceCategory::STATUS_ALL )
    {
        return $this->getCategory( $id, $userId, $status );
    }

    /**
     *  get many UserServiceCategories
     */
    public function getUserServiceCategories( $searchKey=null, $status=BaseCategory::STATUS_OPEN, $page=1, $rowCount=BaseMapper::DEFAULT_ROW_COUNT ) 
    {
        return $this->getCategories( $searchKey, $status, $page, $rowCount );
    }

    /**
     *  get count by "getUserServiceCategories" method
     */
    public function getNumUserServiceCategories( $searchKey=null, $status=UserServiceCategory::STATUS_OPEN ) 
    {
        return $this->getNumCategories( $searchKey, $status );
    }

    /* ================================================================================
        about model object
    ================================================================================ */

    /**
     *  set mapRow by pure database record
     */
    public function mapRow($row)
    {
        return parent::mapRow($row);
    }

}

